<template>
  <div>
    <DetailPage v-bind="BaseFormConfig" :model="baseInfo" style="width: 100%; margin: 0 auto"> 
	</DetailPage>
    <DetailPage v-bind="ExtendFormConfig" :model="baseInfo" style="width: 100%; margin: 0 auto"> 
	</DetailPage>
    <DetailPage v-bind="OtherFormConfig" :model="baseInfo" style="width: 100%; margin: 0 auto"> 
	</DetailPage>
  <div style="margin-left: 20px;">
    <div class="node-label">评估档案</div>
    <AssessArchival :nowRowData="nowRowData"></AssessArchival>
  </div>
  <div style="margin-left: 20px;">
    <div class="node-label">健康档案</div>
    <HealthArchival :nowRowData="nowRowData"></HealthArchival>
  </div>
  <div style="margin-left: 20px;">
    <div class="node-label">入院相关记录</div>
    <CheckInRecord :nowRowData="nowRowData"></CheckInRecord>
  </div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, toRefs, onMounted} from 'vue'
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import {BaseFormConfig,ExtendFormConfig,OtherFormConfig} from '@/views/datacenter/basicData/oldman/components/config'
import apiMod from '@/apiMod/index'
import {getAreaObj} from '@/utils/util'
import AssessArchival from '@/views/datacenter/basicData/oldman/components/Archives/EvaluateRate/index.vue'
import HealthArchival from '@/views/datacenter/basicData/oldman/components/Archives/healthArchives/index.vue'
import CheckInRecord from './checkInRecord/index.vue'

let props = defineProps({
  nowRowData:{
    type:Object,
    default:()=>({})
  }
})
let baseInfo:any = ref({}) 
const getInfo = () =>{
  let params = {
    idCard:props.nowRowData.idCard
  }
  apiMod.view_dpServiceObjectAll_view(params).then(res=>{
    if(res.code== 0&&res.data.dpServiceObjects.length>0){
      // 处理一下区域
      
      baseInfo.value = res.data.dpServiceObjects[0]
      let data:any = getAreaObj( baseInfo.value,'cr','set')
      baseInfo.value.crAreas = getAreaObj(  baseInfo.value,'cr')
      baseInfo.value.cr_areas = data.names
      baseInfo.value.areas = getAreaObj( baseInfo.value)
      baseInfo.value.areas_name = data.names
    }
  })
}
getInfo()
</script>
<style scoped lang="scss">
</style>